<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        let goods = {
            name: '小米10PLS',
            num: 99,
            weight: 10,
            address: '西安',
            add: function () {
                this.num++;
            }
        }
        goods.name = '小米15'
        goods.color = '粉色'
        for (let k in goods) {
            console.log(k + ':' + goods[k]);
        }
        goods.add();
        document.write('num:' + goods.num)
    </script>
</body>

</html>